<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org" lang="zh">
    <body>
        <script th:fragment="pages">
            var laypage_curr;
            var laypage_limit;
            layui.use(['laypage','layer'],function () {
                var laypage = layui.laypage,layer = layui.layer;
                var page=[[${lists.pages}]];
                var count=[[${lists.total}]];
                laypage.render({
                    elem: 'pages'  //指向存放分页的容器
                    , count: count //总页数
                    , limits: [10,20,30,40]  //每页显示多少条数
                    , first: '首页'  //自定义"首页"内容
                    , last: '尾页'   //自定义"尾页"内容
                    , layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']   //页面布局
                    , theme: '#4D4DFF'  //样式
                    , groups: 3 //连续显示分页数
                    , hash: true
                    //curr: $(".laypage_curr").text() || 1, //当前页
                    , jump: function(obj, first){ //触发分页后的回调
                        //console.log(obj.curr);
                        if(!first){ //一定要加此判断，否则初始时会无限刷新
                            //console.log(e.curr);
                            laypage_curr=obj.curr;
                            laypage_limit=obj.limit;
                            reload();
                        }
                    }
                })
            });
        </script>
    </body>


</html>